(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
lt(0, s(x)) → true
lt(x, 0) → false
lt(s(x), s(y)) → lt(x, y)
fibo(0) → fib(0)
fibo(s(0)) → fib(s(0))
fibo(s(s(x))) → sum(fibo(s(x)), fibo(x))
fib(0) → s(0)
fib(s(0)) → s(0)
fib(s(s(x))) → if(true, 0, s(s(x)), 0, 0)
if(true, c, s(s(x)), a, b) → if(lt(s(c), s(s(x))), s(c), s(s(x)), b, c)
if(false, c, s(s(x)), a, b) → sum(fibo(a), fibo(b))
sum(x, 0) → x
sum(x, s(y)) → s(sum(x, y))
Rewrite Strategy: INNERMOST
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
lt(0', s(x)) → true
lt(x, 0') → false
lt(s(x), s(y)) → lt(x, y)
fibo(0') → fib(0')
fibo(s(0')) → fib(s(0'))
fibo(s(s(x))) → sum(fibo(s(x)), fibo(x))
fib(0') → s(0')
fib(s(0')) → s(0')
fib(s(s(x))) → if(true, 0', s(s(x)), 0', 0')
if(true, c, s(s(x)), a, b) → if(lt(s(c), s(s(x))), s(c), s(s(x)), b, c)
if(false, c, s(s(x)), a, b) → sum(fibo(a), fibo(b))
sum(x, 0') → x
sum(x, s(y)) → s(sum(x, y))
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
lt(0', s(x)) → true
lt(x, 0') → false
lt(s(x), s(y)) → lt(x, y)
fibo(0') → fib(0')
fibo(s(0')) → fib(s(0'))
fibo(s(s(x))) → sum(fibo(s(x)), fibo(x))
fib(0') → s(0')
fib(s(0')) → s(0')
fib(s(s(x))) → if(true, 0', s(s(x)), 0', 0')
if(true, c, s(s(x)), a, b) → if(lt(s(c), s(s(x))), s(c), s(s(x)), b, c)
if(false, c, s(s(x)), a, b) → sum(fibo(a), fibo(b))
sum(x, 0') → x
sum(x, s(y)) → s(sum(x, y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
lt,
fibo,
fib,
sum,
ifThey will be analysed ascendingly in the following order:
lt < if
fibo = fib
sum < fibo
fibo = if
fib = if
sum < if
(6) Obligation:
Innermost TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
lt, fibo, fib, sum, if
They will be analysed ascendingly in the following order:
lt < if
fibo = fib
sum < fibo
fibo = if
fib = if
sum < if
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
lt(
gen_0':s3_0(
n5_0),
gen_0':s3_0(
+(
1,
n5_0))) →
true, rt ∈ Ω(1 + n5
0)
Induction Base:
lt(gen_0':s3_0(0), gen_0':s3_0(+(1, 0))) →RΩ(1)
true
Induction Step:
lt(gen_0':s3_0(+(n5_0, 1)), gen_0':s3_0(+(1, +(n5_0, 1)))) →RΩ(1)
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) →IH
true
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
sum, fibo, fib, if
They will be analysed ascendingly in the following order:
fibo = fib
sum < fibo
fibo = if
fib = if
sum < if
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
sum(
gen_0':s3_0(
a),
gen_0':s3_0(
n354_0)) →
gen_0':s3_0(
+(
n354_0,
a)), rt ∈ Ω(1 + n354
0)
Induction Base:
sum(gen_0':s3_0(a), gen_0':s3_0(0)) →RΩ(1)
gen_0':s3_0(a)
Induction Step:
sum(gen_0':s3_0(a), gen_0':s3_0(+(n354_0, 1))) →RΩ(1)
s(sum(gen_0':s3_0(a), gen_0':s3_0(n354_0))) →IH
s(gen_0':s3_0(+(a, c355_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(11) Complex Obligation (BEST)
(12) Obligation:
Innermost TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
sum(gen_0':s3_0(a), gen_0':s3_0(n354_0)) → gen_0':s3_0(+(n354_0, a)), rt ∈ Ω(1 + n3540)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
fib, fibo, if
They will be analysed ascendingly in the following order:
fibo = fib
fibo = if
fib = if
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol fib.
(14) Obligation:
Innermost TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
sum(gen_0':s3_0(a), gen_0':s3_0(n354_0)) → gen_0':s3_0(+(n354_0, a)), rt ∈ Ω(1 + n3540)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
if, fibo
They will be analysed ascendingly in the following order:
fibo = fib
fibo = if
fib = if
(15) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol if.
(16) Obligation:
Innermost TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
sum(gen_0':s3_0(a), gen_0':s3_0(n354_0)) → gen_0':s3_0(+(n354_0, a)), rt ∈ Ω(1 + n3540)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
The following defined symbols remain to be analysed:
fibo
They will be analysed ascendingly in the following order:
fibo = fib
fibo = if
fib = if
(17) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol fibo.
(18) Obligation:
Innermost TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
sum(gen_0':s3_0(a), gen_0':s3_0(n354_0)) → gen_0':s3_0(+(n354_0, a)), rt ∈ Ω(1 + n3540)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
No more defined symbols left to analyse.
(19) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
(20) BOUNDS(n^1, INF)
(21) Obligation:
Innermost TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
sum(gen_0':s3_0(a), gen_0':s3_0(n354_0)) → gen_0':s3_0(+(n354_0, a)), rt ∈ Ω(1 + n3540)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
No more defined symbols left to analyse.
(22) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
(23) BOUNDS(n^1, INF)
(24) Obligation:
Innermost TRS:
Rules:
lt(
0',
s(
x)) →
truelt(
x,
0') →
falselt(
s(
x),
s(
y)) →
lt(
x,
y)
fibo(
0') →
fib(
0')
fibo(
s(
0')) →
fib(
s(
0'))
fibo(
s(
s(
x))) →
sum(
fibo(
s(
x)),
fibo(
x))
fib(
0') →
s(
0')
fib(
s(
0')) →
s(
0')
fib(
s(
s(
x))) →
if(
true,
0',
s(
s(
x)),
0',
0')
if(
true,
c,
s(
s(
x)),
a,
b) →
if(
lt(
s(
c),
s(
s(
x))),
s(
c),
s(
s(
x)),
b,
c)
if(
false,
c,
s(
s(
x)),
a,
b) →
sum(
fibo(
a),
fibo(
b))
sum(
x,
0') →
xsum(
x,
s(
y)) →
s(
sum(
x,
y))
Types:
lt :: 0':s → 0':s → true:false
0' :: 0':s
s :: 0':s → 0':s
true :: true:false
false :: true:false
fibo :: 0':s → 0':s
fib :: 0':s → 0':s
sum :: 0':s → 0':s → 0':s
if :: true:false → 0':s → 0':s → 0':s → 0':s → 0':s
hole_true:false1_0 :: true:false
hole_0':s2_0 :: 0':s
gen_0':s3_0 :: Nat → 0':s
Lemmas:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
Generator Equations:
gen_0':s3_0(0) ⇔ 0'
gen_0':s3_0(+(x, 1)) ⇔ s(gen_0':s3_0(x))
No more defined symbols left to analyse.
(25) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
lt(gen_0':s3_0(n5_0), gen_0':s3_0(+(1, n5_0))) → true, rt ∈ Ω(1 + n50)
(26) BOUNDS(n^1, INF)